﻿Imports QueComer

Public Class BuscarUsuarios

    Private Sub btnBuscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuscar.Click
        Try
            'Dim dni As String = Me.xdni.Text
            Dim ape_pat As String = Me.xapellido.Text
            Dim ciudad As String = Me.xciudad.Text
            Dim rol As String = Me.xrol.Text

            Dim negocio As New BuscarUsuario
            Dim usuarios As Collection = negocio.buscar(ape_pat, ciudad, rol)
            Me.dgvUsuarios.DataSource = usuarios
            Me.dgvUsuarios.EditMode = False

            'Me.dgvUsuarios.Columns(2).HeaderText = "DNI"
            Me.dgvUsuarios.Columns(5).HeaderText = "APELLIDO PATERNO"
            Me.dgvUsuarios.Columns(9).HeaderText = "CIUDAD"
            Me.dgvUsuarios.Columns(13).HeaderText = "ROL"

            Me.dgvUsuarios.Columns("id_usuario").Visible = False
            Me.dgvUsuarios.Columns("dni").Visible = False
            Me.dgvUsuarios.Columns("passw").Visible = False
            Me.dgvUsuarios.Columns("email").Visible = False
            Me.dgvUsuarios.Columns("ape_mat").Visible = False
            Me.dgvUsuarios.Columns("nombre").Visible = False
            Me.dgvUsuarios.Columns("fec_nac").Visible = False
            Me.dgvUsuarios.Columns("pais").Visible = False
            Me.dgvUsuarios.Columns("telefono_fijo").Visible = False
            Me.dgvUsuarios.Columns("direccion").Visible = False
            Me.dgvUsuarios.Columns("telefono_movil").Visible = False

        Catch ex As Exception
            Me.LabelError.Text = "No se encontraron registros"
        End Try
    End Sub

    Private Sub Usuarios_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    End Sub


    Private Sub LabelError_Click(sender As System.Object, e As System.EventArgs) Handles LabelError.Click

    End Sub

    Private Sub xapellido_MaskInputRejected(sender As System.Object, e As System.Windows.Forms.MaskInputRejectedEventArgs) Handles xapellido.MaskInputRejected

    End Sub
End Class